package com.icart.repositories;


import com.icart.entities.CuCusttcdiscfeeEntity;
import org.springframework.context.annotation.Scope;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
@Scope("prototype")
public interface CusttcdiscfeeRepository extends BaseRepository<CuCusttcdiscfeeEntity,Integer> {
    @Transactional
    @Query(nativeQuery = true,value = "insert into cu_custtcdiscfee (tcoid, custid, feeid, tcid, feeobj, feeobjid, treeid, feecaltype, feeval, remark) " +
            "select ?1, ?2, feeid, tcid, feeobj, feeobjid, treeid, feecaltype, feeval, remark from mk_discfee where tcid=?3")
    @Modifying(clearAutomatically = true)
    Integer save(Long tcoid,Long custid,Long tcid);
}
